{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Highcharts Demos\n",
    "=================\n",
    "Spiderweb: http://www.highcharts.com/demo/polar-spider\n",
    "-------------------------------------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<iframe style=\"border:0;outline:none;overflow:hidden\" srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;utf-8&quot; /&gt;\n",
       "        &lt;link href=&quot;https://www.highcharts.com/highslide/highslide.css&quot; rel=&quot;stylesheet&quot; /&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts-more.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;/head&gt;\n",
       "    &lt;body style=&quot;margin:0;padding:0&quot;&gt;\n",
       "                &lt;div id=&quot;test&quot; style=&quot;width:550px;height:400px;&quot;&gt;Loading....&lt;/div&gt;\n",
       "\n",
       "\n",
       "    &lt;script&gt;\n",
       "        $(function(){\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "            Highcharts.setOptions({&quot;lang&quot;: {}, &quot;global&quot;: {}});\n",
       "            var option = {&quot;loading&quot;: {}, &quot;subtitle&quot;: {}, &quot;xAxis&quot;: {&quot;lineWidth&quot;: 0, &quot;tickmarkPlacement&quot;: &quot;on&quot;, &quot;categories&quot;: [&quot;Sales&quot;, &quot;Marketing&quot;, &quot;Development&quot;, &quot;Customer Support&quot;, &quot;Information Technology&quot;, &quot;Administration&quot;]}, &quot;title&quot;: {&quot;text&quot;: &quot;Budget vs spending&quot;, &quot;x&quot;: -80}, &quot;series&quot;: {}, &quot;labels&quot;: {}, &quot;yAxis&quot;: {&quot;lineWidth&quot;: 0, &quot;gridLineInterpolation&quot;: &quot;polygon&quot;, &quot;min&quot;: 0}, &quot;chart&quot;: {&quot;width&quot;: 550, &quot;polar&quot;: true, &quot;renderTo&quot;: &quot;test&quot;, &quot;type&quot;: &quot;line&quot;, &quot;height&quot;: 400}, &quot;tooltip&quot;: {&quot;shared&quot;: true, &quot;pointFormat&quot;: &quot;&lt;span style=\\&quot;color:{series.color}\\&quot;&gt;{series.name}: &lt;b&gt;${point.y:,.0f}&lt;/b&gt;&lt;br/&gt;&quot;}, &quot;plotOptions&quot;: {}, &quot;credits&quot;: {&quot;enabled&quot;: false}, &quot;colors&quot;: {}, &quot;pane&quot;: {&quot;size&quot;: &quot;80%&quot;}, &quot;exporting&quot;: {}, &quot;drilldown&quot;: {}, &quot;navigation&quot;: {}, &quot;legend&quot;: {&quot;y&quot;: 70, &quot;layout&quot;: &quot;vertical&quot;, &quot;align&quot;: &quot;right&quot;, &quot;verticalAlign&quot;: &quot;top&quot;}};\n",
       "\n",
       "\n",
       "            var data = [{&quot;data&quot;: [43000, 19000, 60000, 35000, 17000, 10000], &quot;type&quot;: &quot;line&quot;, &quot;name&quot;: &quot;Allocated Budget&quot;, &quot;pointPlacement&quot;: &quot;on&quot;}, {&quot;data&quot;: [50000, 39000, 42000, 31000, 26000, 14000], &quot;type&quot;: &quot;line&quot;, &quot;name&quot;: &quot;Actual Spending&quot;, &quot;pointPlacement&quot;: &quot;on&quot;}]\n",
       "            option.series = data;\n",
       "\n",
       " \n",
       "\n",
       "            var chart = new Highcharts.Chart(option);\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "        \n",
       "    });\n",
       "        &lt;/script&gt;\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\" height=400 width=550></iframe>"
      ],
      "text/plain": [
       "<highcharts.highcharts.highcharts.Highchart at 0x7f2a302ab410>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from highcharts import Highchart\n",
    "H = Highchart(width=550, height=400)\n",
    "\n",
    "options = {\n",
    "    'chart': {\n",
    "        'polar': True,\n",
    "        'type': 'line',\n",
    "        'renderTo': 'test'\n",
    "    },\n",
    "\n",
    "    'title': {\n",
    "        'text': 'Budget vs spending',\n",
    "        'x': -80\n",
    "    },\n",
    "\n",
    "    'pane': {\n",
    "        'size': '80%'\n",
    "    },\n",
    "\n",
    "    'xAxis': {\n",
    "        'categories': ['Sales', 'Marketing', 'Development', 'Customer Support',\n",
    "                'Information Technology', 'Administration'],\n",
    "        'tickmarkPlacement': 'on',\n",
    "        'lineWidth': 0\n",
    "    },\n",
    "\n",
    "    'yAxis': {\n",
    "        'gridLineInterpolation': 'polygon',\n",
    "        'lineWidth': 0,\n",
    "        'min': 0\n",
    "    },\n",
    "\n",
    "    'tooltip': {\n",
    "        'shared': True,\n",
    "        'pointFormat': '<span style=\"color:{series.color}\">{series.name}: <b>${point.y:,.0f}</b><br/>'\n",
    "    },\n",
    "\n",
    "    'legend': {\n",
    "        'align': 'right',\n",
    "        'verticalAlign': 'top',\n",
    "        'y': 70,\n",
    "        'layout': 'vertical'\n",
    "    },\n",
    "}\n",
    "\n",
    "data1 = [43000, 19000, 60000, 35000, 17000, 10000]\n",
    "data2 = [50000, 39000, 42000, 31000, 26000, 14000]\n",
    "\n",
    "H.set_dict_options(options)\n",
    "H.add_data_set(data1, name='Allocated Budget', pointPlacement='on')\n",
    "H.add_data_set(data2, name='Actual Spending',  pointPlacement='on')\n",
    "\n",
    "H"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
